package com.example.boot3.service.Impl;

import com.example.boot3.mapper.FleetMapper;
import com.example.boot3.mapper.RepairMapper;
import com.example.boot3.model.Repair;
import com.example.boot3.service.FleetService;
import com.example.boot3.service.RepairService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service
public class FleetServiceImpl implements FleetService {
    @Autowired
    FleetMapper fleetMapper;

    @Override
    public Integer addFleet(String fleet_name) {
        try {
            fleetMapper.addFleet(fleet_name);
            return 1;
        } catch (DuplicateKeyException e) {
            // 捕获唯一键约束冲突的异常
            return 0;

        }
    }



}
